Skip to main content

Get Lua Script

It gets another Lua script from an InteractTriggerX, LuaComponent or other component containing a Lua script.

Example#

The following example gets the InteractWeapon component from variable self.gameObj and stores it in interactWeapon variable.

local luaScript = self.componentWithLuaScript.script.self

User Variables#

Componentvariable
InteractTriggerXself.componentWithLuaScript

FAQ#

What if I want to print a variable from another script?#

local luaScript = self.componentWithLuaScript.script.selfprint(luaScript.yourVariable)